
/**
 * 
 * @description Engine to render an abstract data to pure HTML
 * @constructor
 * @class
 * @version 0.1a
 */ 
function SntSwfobjectEmbed(){
	// error status, default is fine
	this.status = true;
	this.callback = null;
	return this;
};

SntSwfobjectEmbed.prototype = {	
	/**
	 * @function
	 * @description Set callback function
	 * @param fn callback function or null
	 * @return void
	 */
	setCallback : function(fn){
		this.callback = fn;
	},	
	/** 
	 * @function
	 * @description Render all received data to object element with required params.
	 *				This function used {@link SntEmbed#render}
	 * @param id Id of the holder
	 * @param swfMovie path to the swf 
	 * @param size an array with two elements `width` and `height` with video holder size
	 * @param flashvars array with flashvars
	 * @param params array with parameters
	 * @param attributes an array with attributes
	 * @render status of the rendering
	 */
	render : function(id, swfMovie, size, flashvars, params, attributes){
		if(swfobject == null)return false;
		if(this.callback != null){	
			Sonettic.Helper.debug("Set callback method: " + this.callback)	
			swfobject.addLoadEvent(this.callback);
		}
			
		swfobject.embedSWF(  
		        swfMovie,   
				id,   
		        size.width,   
		        size.height,   
		        "9.0.0",  
		        "scripts/expressInstall.swf",   
		        flashvars,
		        params,
		        attributes
		);

		return this.status;
	}	
};

